package com.file.homework;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author げっしょく
 * @date 2021/8/2
 */
public class Demo9 {
    public static void main(String[] args) throws IOException {
        String name = "stu.txt";
        FileInputStream fis = new FileInputStream(name);
        FileOutputStream f2 = new FileOutputStream(new File("D:\\", name));
        byte[] bytes = new byte[1024];
        int len = 0;
        while((len = fis.read(bytes)) != -1){
            f2.write(bytes);
        }

    }
}
